<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="cmcc.resource.*"%>
<%@ page import="cmcc.customer.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<% 
	String str_customer_id = request.getParameter("customer_id");
	int csutomer_id = 0;
	if(str_customer_id==null&&str_customer_id.equals("")){
		return;
	}
	csutomer_id = Integer.parseInt(str_customer_id);
	Customer c = Customer.getCustomerBycustomer_id(csutomer_id);
	String type="";
	if(c.getId_type().toLowerCase().equals("d")){
		type="身份证";
	}else if(c.getId_type().toLowerCase().equals("a")){
		type="军官证";
	}else if(c.getId_type().toLowerCase().equals("d")){
		type="护照";
	}
%>
<% 
	int wide = 12;
	String strPageNo = request.getParameter("pageNo");
	int pageNo=1;
	if(strPageNo!=null && !strPageNo.equals("")){
		pageNo = Integer.parseInt(strPageNo);		
	}	
	
	int count = Resource.getCount();
	int allPage = count%wide==0 ? count/wide : count/wide+1;	
	if(pageNo<1){
		pageNo=allPage;
	}
	if(pageNo>allPage){
		pageNo=1;
	}
	
	System.out.println("共 "+allPage+" 页  ------- 第 "+pageNo+" 页");
	int start = (pageNo-1) *12;
	HashSet<String> nums = Resource.getAvailableNnmber(start,wide);
	//ArrayList<Operator> list = Operator.getList(start, wide);
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    
    <title>My JSP 'addMoble.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    <font size="2">	您现在的位置:新增用户>第一步</font>
		<br>
            客户信息：<br>
  客户姓名：<%=c.getCustomer_name() %>
  	
 <form action="checkNumber.jsp" method="post" >
 	请输入可以的手机号吗：
 	<input type="text" name="mobile_number">
 	<input type="submit" value="提交">
 </form>   
    
    
    <div align="center">
    	<table align="center" >
    		<% 
    			Iterator<String> i_starts = nums.iterator();
    			for(Iterator<String> i = nums.iterator(); i.hasNext();){
    				String num1 = "";
    				String num2 = "";
    				String num3 = "";
    				num1 = i.next();
    				if(i.hasNext()){
    					num2 = i.next();	
    				} 
    				if(i.hasNext()){
    					num3 = i.next();	
    				} 	

    		%>
    		<tr>
    			<td><%="   "+num1+"   " %></td>
    			<td><%="   "+num2+"   " %></td>
    			<td><%="   "+num3+"   " %></td>
    		</tr>
    		
    		<% 
    			}
    		%>
    		
    	</table>
    </div>
    
    <h4 align="center">
    	 <a href=" addMobile.jsp?pageNo=<%=pageNo-1%>" >上一批</a>
		&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
		<a href=" addMobile.jsp?pageNo=<%=pageNo+1%>">下一批</a>
    </h4>
  
  </body>
</html>
